home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / QUI / UTI / Premier Plug-In Kit 1.0.cpt / Premier Plug-In Kit 1.0 / MPW Examples / .c / Cross Dissolve.c < prev    next >
Text File  |  1992-03-04  |  1KB  |  41 lines

  1. //———————————————————————————————————————————————
  2. //
  3. //    ©1991 Adobe Systems Inc.
  4. //    written by Randy Ubillos
  5. //
  6. //———————————————————————————————————————————————
  7.  
  8. // Load in your favorite Mac headers here...
  9. #pragma load "headers.d"
  10.  
  11. #include "Interface-Effect.h"
  12.  
  13. //———————————————————————————————————————————————
  14. // Perform the effect
  15.  
  16. pascal short xEffect(short selector, EffectHandle theData)
  17. {
  18.     short                result = 0,spot;
  19.     Rect                box;
  20.     RGBColor            thecolor;
  21.  
  22.     switch (selector) {
  23.         case esExecute:                                                        // here's the start
  24.             box = ((GrafPtr)(*theData)->destination)->portRect;                // find bounds
  25.             spot = (*theData)->part * (long)65535 / (*theData)->total;        // calc transparency
  26.             thecolor.red = thecolor.green = thecolor.blue = spot;            // set up the 'color'
  27.             OpColor(&thecolor);                                                // set mix level
  28.             CopyBits((BitMap*)&(*theData)->source1->portPixMap,                // copy all of src 1
  29.                         (BitMap*)&(*theData)->destination->portPixMap,
  30.                                                         &box,&box,srcCopy,nil);
  31.             CopyBits((BitMap*)&(*theData)->source2->portPixMap,                // mix in some of src 2
  32.                         (BitMap*)&(*theData)->destination->portPixMap,
  33.                                                             &box,&box,blend,nil);
  34.             break;
  35.         case esSetup:                                                        // we don't need setup
  36.             break;
  37.     }
  38.     return(result);
  39. }
  40.  
  41.